const validator = (validateFn) => {
  return (rule, value) => {
    if (validateFn(value)) {
      return Promise.resolve()
    }
    return Promise.reject(rule.message)
  }
}

export default validator
